import App from './App'
import store from '@/store';
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
// 引入路由
import {
	router,
	RouterMount
} from './common/router.js';
Vue.use(router);
import Mylink from './node_modules/uni-simple-router/dist/link.vue'
Vue.component('my-link', Mylink)
// 引入uview
import uView from '@/uni_modules/uview-ui';
Vue.use(uView);
// 需要在Vue.use(uView)之后执行
uni.$u.setConfig({
	// 修改$u.config对象的属性
	config: {
		// 修改默认单位为rpx，相当于执行 uni.$u.config.unit = 'rpx'
		unit: 'rpx'
	},
	// 修改$u.props对象的属性
	props: {
		// 修改radio组件的size参数的默认值，相当于执行 uni.$u.props.radio.size = 30
		formItem: {
			labelWidth: 80
		}
		// 其他组件属性配置
		// ......
	}
})
import mixin from '@/common/mixin'
Vue.mixin(mixin)
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	store,
	...App
})
// http拦截器，将此部分放在new Vue()和app.$mount()之间，才能App.vue中正常使用
import httpInterceptor from '@/service/http.interceptor.js'
Vue.use(httpInterceptor, app)
// http接口API集中管理引入部分
import {
	api,
	deviceapi,
	groupapi,
	postAction,
	getAction,
} from '@/service/api.js'
Vue.prototype.$api = api;
Vue.prototype.$deviceapi = deviceapi;
Vue.prototype.$groupapi = groupapi;
Vue.prototype.$postAction = postAction;
Vue.prototype.$getAction = getAction;
import Gm501 from 'mcbluetoothsdk/dist/lib/Gm501'
Vue.prototype.$snGm501 = Gm501
app.$mount()
// #endif

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	return {
		app
	}
}
// #endif